package cn.javass.dp.composite.example2;

public class Client {
    public static void main(String[] args) {
        Composite root = new Composite();
        Compoment c1 = new Composite();
        Compoment c2 = new Composite();
        Compoment l1 = new Leaf();
        Compoment l2 = new Leaf();
        Compoment l3 = new Leaf();

        root.addChild(c1);
        root.addChild(c2);
        root.addChild(l1);

        c1.addChild(l2);
        c2.addChild(l3);

        System.out.println(root.getChildren(1));


    }
}
